home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 4thcmp21.zip / UNSCREEN.4TH < prev    next >
Text File  |  1993-06-23  |  1KB  |  53 lines

  1. \ UNSCREEN  PROGRAM, BY TOM ALMY.
  2. \ THIS PROGRAM IS COPYRIGHT (C) 1985 BY TOM ALMY,
  3. \ ALL RIGHTS RESERVED.
  4. \ Permission is granted to registered users of ForthCMP to sell or distribute
  5. \ computer programs incorporating the compiled contents of this file.
  6.  
  7.  
  8. \ YOU MIGHT ALSO WANT TO MAKE THIS SMARTER, LIKE DELETING
  9. \ EXTRA BLANK LINES, "-->" COMMANDS, START ON SCREEN 1 OR 2...
  10.  
  11. 100 MSDOS
  12. SCONSTANT SDEFSTR SCR" ( SOURCE DEFAULTS TO .SCR )
  13. SCONSTANT DDEFSTR 4TH" ( DESTINATION  DEFAULTS TO .4TH )
  14. 16384 CONSTANT BUFSIZ
  15. INCLUDE VARS
  16. INCLUDE FILTER
  17.  
  18. 0 1 IN/OUT
  19. : UNSCREEN?   ( -- successflag )
  20.   HERE 64 EXPECT  ( get a line )
  21.   SPAN @ 0> DUP IF (  got one )
  22.       HERE SPAN @  -TRAILING  TYPE  CR
  23.       THEN
  24.   ;
  25.  
  26. 0 0 IN/OUT 
  27. : NOTICE  CONSOLE  CR
  28.   ." FORTH UN-SCREEN CONVERSION PROGRAM " CR
  29.   ." COPYRIGHT (C) 1985 BY THOMAS ALMY " CR ;
  30.  
  31. 0 0 IN/OUT 
  32. : USAGE   CONSOLE
  33.  ." USAGE:  UNSCREEN  [SCRFILE] [TXTFILE] " CR
  34.  ." where SCRFILE (default .SCR) is a file of Forth screens" CR
  35.  ."  if absent or `-' then standard input is used" CR
  36.  ." and TXTFILE (default .4TH) is output file." CR
  37.  ABORT
  38.   ;
  39.  
  40. : MAIN
  41.     SETBUFS ( allows I/O )
  42.     NOTICE    ( Welcome Message )
  43.     SETFILES IF USAGE THEN ( Indicate failure )
  44.     OPTIONSTRING 2+ @ IF USAGE THEN
  45.     BEGIN  UNSCREEN? NOT UNTIL
  46.     BYE ;
  47.  
  48. INCLUDE DOS2
  49. INCLUDE FORTHLIB
  50.  
  51. END
  52.  
  53.